{include file="common/header" /}

<body>
{include file="common/top" /}
<!--产品列表样式-->
<div class="Inside_pages"> 
    <!--位置-->
    <div id="Filter_style">
        <div class="Location_link"> <em></em><a href="javascript:void(0)">全部</a></div>
        <!--条件筛选样式-->
        <div class="Filter" id="Filter">
          <div class="Filter_list clearfix">
           <div class="Filter_title">全部分类：</div>
           {volist name="types" id="vo"}
           <div class="p_f_name">
              <div class="typelist">
                  <a href="{:url('goods/getGoodsByCategory',['id'=>$vo.id])}">{$vo.name}</a>
              </div>
            <p>
                {volist name="childType" id="child"}
                {if $vo.id == $child.parent_id} 
                <a href="{:url('goods/getGoodsByCategory',['cid'=>$child.id])}" class="second_type" title="{$child.name}">{$child.name} </a> {/if}
                {/volist}
            </p>
           </div>
           {/volist}
      </div>
      </div>
    </div>
    <!--产品列表样式-->
    <div id="Sorted" class="">
        <div class="Sorted">
            <div class="Sorted_style"> <a href="#" class="on">综合<i class="iconfont icon-fold"></i></a> <a href="javascript:void(0)" class="order" title="人气从高到低" value="clicks">人气<i class="iconfont icon-fold"></i></a> <a href="javascript:void(0)" class="order" title="销量从高到低" value="sales">销量<i class="iconfont icon-fold"></i></a> <a href="#">价格<i class="iconfont icon-fold"></i></a> </div>
            <!--产品搜索-->
            <div class="products_search">
                <input name="" type="text" class="search_text" value="请输入你要搜索的产品" onfocus="this.value=''" onblur="if(!value){value=defaultValue;}">
                <input name="" type="submit" value="" class="search_btn">
            </div>
            <!--页数-->
            <div class="s_Paging"> <span> 1/12</span> <a href="#" class="on">&lt;</a> <a href="#">&gt;</a> </div>
        </div>
    </div>
    <div class="p_list  clearfix">
        <ul class="product">
            {volist name="products" id="vo"}
            <li class="gl-item">
                <div class="Borders">
                 <div class="img"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" target="_blank"><img src="{$vo.picture}" style="width:220px;height:220px"></a></div>
                 <div class="Price"><b>¥{$vo.price}</b></div>
                 <div class="name"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" target="_blank">{$vo.gname}</a></div>
                <div class="Shop_name"><a href="{:url('goods/goods_detail',['id'=>$vo.id])}" target="_blank">{$vo.brand}</a></div>
                 <div class="p-operate">
                  <a href="#" class="p-o-btn Collect"><em></em>收藏</a>
                  <a href="#" class="p-o-btn shop_cart"><em></em>联系我们</a>
                 </div>
                 </div>
            </li>
            {/volist}
        </ul>
        <div class="tp5-o2o">{$products->render()}</div>
    </div>
</div>

{include file="common/footer" /}
<!--右侧菜单栏购物车样式-->
<div class="fixedBox">
    <ul class="fixedBoxList">
        <li class="fixeBoxLi user"><a href="#"> <span class="fixeBoxSpan"></span> <strong>消息中心</strong></a> </li>
        <li class="fixeBoxLi Home"> <a href="./"> <span class="fixeBoxSpan"></span> <strong>收藏夹</strong> </a> </li>
        <li class="fixeBoxLi BackToTop"> <span class="fixeBoxSpan"></span> <strong>返回顶部</strong> </li>
    </ul>
</div>
<script>
$('.order').click(function(){
    $('.product').empty();
    var str = location.href;
    var num = str.indexOf('?');
    str = str.substr(num + 1);
    var id = str.split('=')[0];
    var value = str.split('=')[1];
    order = $(this).attr('value');
    url = "{:url('goods/orderby')}";
    data = {
            'order' : order,
            'id_type' : id,
            'id' : value 
        };
    $.post(url,data,function(result){
        if (result.status == 1) {
            var url = "{:url('goods/goods_detail')}";
            data = result.data;
            pro_html = '';
            $(data).each(function(i){
                pro_html += '<li class="gl-item"><div class="Borders"><div  class="img"><a href="'+url + '?id=' + this.id +'" target="_blank"><img src="'+ this.picture +'" style="width:220px;height:220px"></a></div><div  class="Price"><b>¥'+this.price+'</b></div><div  class="name"><a href="'+url + '?id=' + this.id +'" target="_blank">'+this.gname+'</a></div><div class="Shop_name"><a href="'+url + '?id=' + this.id +'" target="_blank">'+ this.brand +'</a></div><div class="p-operate"><a href="#" class="p-o-btn Collect"><em></em>收藏</a><a href="#" class="p-o-btn shop_cart"><em></em>联系我们</a></div></div></li>';
            });
            $('.product').html(pro_html);
        }else if(result.status == 0){
            $('.product').html('');
            return;
        }
    });
});
</script>
</body>
</html>
